<template>
	<div>
		<div class="top" style="float:left;width:300px">
		    <ButtonGroup>
		        <Button @click="changeType(1)" :class="{active:formValidate.type===1}">新闻分类</Button>
		        <Button @click="changeType(2)" :class="{active:formValidate.type===2}">上传分类</Button>
		        <Button @click="changeType(3)" :class="{active:formValidate.type===3}">产品分类</Button>
		    </ButtonGroup>
		    <Tree :data="baseData" @on-select-change="onCheckChange" ></Tree>
		    <Button type="primary" @click="onadd">添加</Button>
		    <Button type="ghost" @click="updateChange">修改</Button>
		    <Button type="dashed" @click="onChanges">删除</Button>
	    </div>
	    <div style="width:500px;float:left">
			 <Input v-model="formValidate.title">
					<span slot="append"  @click="onAddChange">添加根节点</span>
		    </Input>
	    </div>
	</div>
</template>
<script>
	import Case from '../../common/Case.js'
    export default {
    	mixins:[Case],
        data () {
            return {
            	module1:"cates",
               
            }
        },
        methods:{
//      	changeType(type){
//      		this.formValidate.type=type;
//      		this.getTree(type)
//      	},
//      	getTree(type){
//      		this.$http({
//	        		url:"http://localhost:3000/cates/list/"+type,
//	        		method:"get"
//	        	}).then(res=>{
//	//      		console.log(res)
//	        		this.baseData=res.data
//	        	})
//      	}
        }
    }
</script>
<style scoped>
	.active{
		background:orangered;
	}
</style>